package lucava.metamodel.java;

import lucava.metamodel.java.type.MetaType;
import lucava.metamodel.java.visitor.IJavaMetaModelVisitor;

public class Variable implements IModifiableEntity, IVisibleEntity {

	protected String mName;

	protected MetaType mType;

	protected Object mValue;

	protected final Visibility mVisibility = new Visibility();

	protected final Modifier mModifier = new Modifier();

	public String getName() {
		return mName;
	}

	public void setName(String mName) {
		this.mName = mName;
	}

	public MetaType getType() {
		return mType;
	}

	public void setType(MetaType mType) {
		this.mType = mType;
	}

	public Object getValue() {
		return mValue;
	}

	public void setValue(Object mValue) {
		this.mValue = mValue;
	}

	public void accept(IJavaMetaModelVisitor aVisitor) {
		aVisitor.visitVariable(this);
	}

	public String getVisibilityAsString() {
		return this.mVisibility.toString();
	}

	public Modifier getModifier() {
		return mModifier;
	}

	public void setPrivate() {
		this.mVisibility.setPrivate();
	}

	public void setProtected() {
		this.mVisibility.setProtected();
	}

	public void setPublic() {
		this.mVisibility.setPublic();
	}

	public boolean isAbstract() {
		return this.mModifier.isAbstract();
	}

	public void setAbstract(boolean mIsAbstract) {
		this.mModifier.setAbstract(mIsAbstract);
	}

	public boolean isFinal() {
		return this.mModifier.isFinal();
	}

	public void setFinal(boolean mIsFinal) {
		this.mModifier.setFinal(mIsFinal);
	}

	public boolean isStatic() {
		return this.mModifier.isStatic();
	}

	public void setStatic(boolean mIsStatic) {
		this.mModifier.setStatic(mIsStatic);
	}

	public Visibility getVisibility() {
		return mVisibility;
	}

	public boolean isPrivate() {
		return this.mVisibility.isPrivate();
	}

	public boolean isProtected() {
		return this.mVisibility.isProtected();
	}

	public boolean isPublic() {
		return this.mVisibility.isPublic();
	}

}
